package com.westar.tv;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.westar.tv.utils.SharePreferencesUtils;

/**
 * Created by wang-dev
 */
public class BootReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {
        if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)){

            boolean boot= (Boolean)SharePreferencesUtils.get(context,SPKeys.DEFAULT_SP_FILE_NAME,SPKeys.SETTING_BOOT,true);
            if(boot) {
                Intent ootStartIntent = new Intent(context, WelcomeActivity.class);
                ootStartIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                context.startActivity(ootStartIntent);
            }
        }
    }

}
